<template>
    <div class="topWrapper">
        <van-icon name="arrow-left" @click="back(backUrl)" class="leftIcon" />
        <div class="title">{{ title }}</div>
    </div>
</template>

<script setup>
/* eslint-disable */
import router from '@/router';
import { defineProps } from 'vue';

const props = defineProps({
    backUrl: String,
    title: String
})
const back = (backUrl) => {
    router.push(backUrl)
}
</script>

<style lang="less" scoped>
.topWrapper {
    height: 1rem;
    display: flex;
    box-sizing: border-box;
    padding: .2rem .1rem;
    position: relative;
    justify-content: center;
    align-items: center;
    background: white;

    .leftIcon {
        position: absolute;
        left: 5%;
        top: 50%;
        transform: translateY(-50%);
        font-weight: 500;
    }

    .title {
        font-weight: 500;

    }
}
</style>
